﻿using System;
using System.Collections.Generic;
using Acaweb.Data.Contracts;
using Acaweb.Model.Entities;
using Acaweb.Model.Entities.DatosCompuestos;
using Spring.Transaction.Interceptor;
//using NH = NHibernate;

namespace Acaweb.Data.Dao.NHibernate
{
    public class PlanesEstudiosDao : HibernateDao<PlanesEstudios, int>, IPlanesEstudiosDao
    {
        [Transaction(ReadOnly = true)]
        public IList<PlanesEstudios> GetAll()
        {
            return GetAll<PlanesEstudios>();
        }

        public IList<PlanesEstudios> GetByFacultad(int CodigoFacultad)
        {
            return this.Session.QueryOver<PlanesEstudios>().Where(t => t.CodigoFacultad == CodigoFacultad).List();
        }

        public IList<PlanesEstudios> GetByTipoPrograma(TipoPrograma TipoPrograma)
        {
            return this.Session.QueryOver<PlanesEstudios>().Where(t => t.TipoPrograma == TipoPrograma && t.Estado == 1 && t.Web == 1).List();
        }
    }
}